home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / ms_sh21s.zip / SH210 / INCLUDE / DIRENT.H next >
C/C++ Source or Header  |  1992-12-14  |  2KB  |  80 lines

  1. /*
  2.  * dirent.h:  definitions for SVR3 directory access routines
  3.  */
  4.  
  5. #ifndef _DIRENT_H
  6. #define _DIRENT_H
  7.  
  8. #include <sys/types.h>
  9. #include <limits.h>
  10. #include <sys/dirent.h>
  11. #include <sys/proto.h>
  12. #include <sys/null.h>
  13.  
  14. #ifndef _SIZE_T_DEFINED        /* Need size_t definition        */
  15. typedef unsigned int    size_t;
  16. #define _SIZE_T_DEFINED
  17. #endif
  18.  
  19. #define    DIRBUF    8192        /* buffer size for fs-indep. dirs    */
  20.                 /* must in general be larger than the    */
  21.                 /* filesystem buffer size        */
  22.  
  23. #ifndef MSDOS
  24. typedef struct
  25. {
  26.     int        dd_fd;        /* file descriptor            */
  27.     int        dd_loc;        /* offset in block            */
  28.     int        dd_size;    /* amount of valid data            */
  29.     char    *dd_buf;    /* -> directory block            */
  30. } DIR;                /* stream data from opendir()        */
  31.  
  32. #else
  33.  
  34. /* MSDOS versions */
  35.  
  36. struct _dircontents {
  37.     char        *_d_entry;
  38.     struct _dircontents    *_d_next;
  39. };
  40.  
  41. typedef struct _dirdesc {
  42.     int            dd_id;    /* uniquely identify each open directory */
  43.     long        dd_loc;    /* where we are in directory entry is this */
  44.     struct _dircontents    *dd_contents;    /* pointer to contents of dir    */
  45.     struct _dircontents    *dd_cp;        /* pointer to current position    */
  46. } DIR;
  47. #endif
  48.  
  49. /* Functions */
  50.  
  51. extern DIR _FAR_ * _FAR_ _CDECL    opendir    _PROTO ((const char _FAR_ *));
  52. extern struct dirent _FAR_ * _FAR_ _CDECL readdir _PROTO ((DIR _FAR_ *));
  53. extern void _FAR_ _CDECL    rewinddir _PROTO ((DIR _FAR_ *));
  54. #ifndef MSDOS
  55. extern int _FAR_ _CDECL        getdents _PROTO ((int, char _FAR_ *,
  56.                           unsigned int));
  57. #endif
  58. extern int _FAR_ _CDECL        closedir _PROTO ((DIR _FAR_ *));
  59. extern void _FAR_ _CDECL    seekdir    _PROTO ((DIR _FAR_ *, off_t));
  60. extern off_t _FAR_ _CDECL    telldir    _PROTO ((DIR _FAR_ *));
  61.  
  62. extern int _FAR_ _CDECL        chdir _PROTO ((const char _FAR_ *));
  63. extern char _FAR_ * _FAR_ _CDECL getcwd _PROTO ((char _FAR_ *, int));
  64. extern int _FAR_ _CDECL        mkdir _PROTO ((const char _FAR_ *, mode_t));
  65. extern int _FAR_ _CDECL        rmdir _PROTO ((const char _FAR_ *));
  66. extern int _FAR_ _CDECL        scandir _PROTO ((char _FAR_ *,
  67.                          struct dirent ***,
  68.                          int (_FAR_ _CDECL *)(const void _FAR_ *, const void _FAR_ *),
  69.                          int (_FAR_ _CDECL *)(const void _FAR_ *, const void _FAR_ *)));
  70.  
  71. #ifdef MSDOS
  72. extern int _FAR_ _CDECL        _chdrive _PROTO ((int));
  73. extern int _FAR_ _CDECL        _getdrive _PROTO ((void));
  74. extern char _FAR_ * _FAR_ _CDECL _getdcwd _PROTO ((int, char _FAR_ *, int));
  75. #ifdef OS2
  76. extern bool            IsHPFSFileSystem _PROTO ((char _FAR_ *));
  77. #endif
  78. #endif
  79. #endif
  80.